//
//  ACEPublicTool.h
//  ACE
//
//  Created by zhangtao on 2018/8/13.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>   //  md5
#import <UIKit/UIKit.h>
@interface ACEPublicTool : NSObject

+(BOOL)currentRoleIsStudent;

//alertView
+(id)initAlertCtlWithTitle:(NSString *)title andMessage:(NSString *)msg andShowCancel:(BOOL)is_showcancel andShowTure:(BOOL)is_showTure andViewController:(UIViewController *)ctl;

//alertView
+(id)initAlertCtlWithTitle:(NSString *)title andMessage:(NSString *)msg andShowCancel:(BOOL)is_showcancel andShowTure:(BOOL)is_showTure andViewController:(UIViewController *)ctl showTure:(void(^)())showture showCancel:(void(^)())showcancel;

/* !@brief 写入 plist
 */
+(void)writeDataToPlist:(id)data andPlistName:(NSString *)plistName;

//读取
+(id)readDataFromPlist:(NSString *)plistName andWillBackType:(NSString *)type;

//根据图片url获取图片尺寸
+(CGSize)getImageSizeWithURL:(id)imageURL;

/*!@brief 获取文本内容高度*/
+(CGSize)textViewTextFont:(UIFont *)font andText:(NSString *)textStr Weight:(CGFloat)weight andHeight:(CGFloat)height;

/*!@brief 获取文本的宽度*/

+(CGSize)textViewWeightWithTextFont:(UIFont *)font andText:(NSString *)testStr andSize:(CGSize)size;


+(NSString *)md5:(NSString *)str;

//返回字体颜色、字体大小、删除线样式、删除线颜色 富文本
+(NSAttributedString *)initAttributedString:(NSString *)str andTextColor:(UIColor *)color andTextSize:(NSInteger)size;


//时间戳转换
+(NSString *)timeIntervalChangeToNowTime:(NSString *)intervalTime;

+(NSString *)dateFormatterChangeToInvertalTimeForMilisecondWithString:(NSString *)str andFormatterStyle:(NSString *)style;

+(NSString *)intervalChangeToTimeWithFormtterStyle:(NSString *)style andInvertal:(id)interval;

// 验证手机号码
+(NSString *)phoneNumWithString:(NSString *)string;

+(NSString *)getCurrentTimeWithFormatterType:(NSString *)type;

+ (BOOL)validatePhoneNumber:(NSString *)num;

//解析支付宝返回的字符串
+(NSDictionary *)VEComponentsStringToDic:(NSString*)result;
+(BOOL)isLoginWithController:(UIViewController *)controller;

//图片限制大小
+ (NSData *)reSizeImage:(UIImage *)sourceImage maxSizeWithKB:(CGFloat) maxSize;


@end
